package com.breezelin.freshmarket.network.asynctasks;

/**
 * Created by Breeze Lin
 * 1:08 2016/5/19
 * 1linyufeng1@gmail.com
 */

import com.breezelin.freshmarket.entities.rsp.QueryRsp;
import com.breezelin.freshmarket.network.FMAsyncTask;
import com.breezelin.freshmarket.network.apis.ContentApi;

/**
 * 根据字符串查询产品的异步任务
 */
public abstract class StringQueryTask extends FMAsyncTask<Void, Void, QueryRsp> {

	/**
	 * 搜索的字串
	 */
	private String string;
	/**
	 * 当前页码
	 */
	private int pageNo;

	/**
	 * @param string 搜索的字串
	 * @param pageNo 需要查询的页码
	 */
	protected StringQueryTask(String string, int pageNo) {
		super(ContentApi.QUERY);
		this.string = string;
		this.pageNo = pageNo;
	}

	@Override
	protected QueryRsp doInBackground(Void... params) {
		return ContentApi.queryString(string, pageNo);
	}
}
